<?php echo $this->session->flashdata('_message'); ?>
<?php
if(!empty($data)){
?>
    <table class="table table-striped table-bordered table-condensed">
    <thead>
        <tr>
            <th>#</th>
            <th>Title</th>
            
            <th>Language</th>
            <th></th>
        </tr></thead>
    </thead>
        <?php 
            foreach($data as $dt):
        ?>
        <tr>
            <td><?php echo $dt->post_id ?></td>
            <td width="80%"><?php 
            
            $title = $this->_global->_unserialize($dt->post_title); 
             echo isset($title[$this->session->userdata('lan')])?$title[$this->session->userdata('lan')]['post_title']:"Không tồn tại bài viết với ngôn ngữ hiện tại" ;
            ?></td>
            <td><?php  
                echo $this->session->userdata('lan');
            ?></td>
            <td><?php
            
             echo  form_open('administrator/setting/translate/post/'.$dt->post_id);?>
            <?php if(!empty($languages)):?>
            Select language:
            <select name="lan">
                <?php foreach($languages as $lang):?>
                    <option value="<?php echo $lang->lang_code?>"><?php echo $lang->lang_name?></option>
                <?php endforeach; ?>
            </select>
            <?php //echo anchor('administrator/setting/translate/post/'.$dt->post_id,'<i class="icon-screenshot"></i> Translate','class="btn"')?>
            <input type="submit" class="btn" value="Translate" />
            </form></td>
            
            <?php endif;?>
        </tr>
        <?php endforeach; ?>
    </table>
<?php
}else{
    echo '<div class="alert alert-info"><h4 class="alert-heading">Thông báo!</h4>Chưa có bài viết nào...</div>';
}
?>
